<?php
namespace Admin\Model;
use Think\Model;

class GoodsModel extends Model{

	public $updateFields = 'goods_id,cat_id,goods_name,goods_number,
							goods_weight,shop_price,goods_desc,
						    goods_brief,ori_img,goods_img,thumb_img,is_best,
						    is_new,is_hot,is_sale,last_update';

	public $_auto = array(
		//array(完成字段1,完成规则,[完成条件,附加规则])
		array('add_time','time','3','function'),
		);

	public $_validate = array(
		//array(验证字段1,验证规则,错误提示,        [验证条件,附加规则,验证时间])
		array('goods_name','3,12','你这个啥子,名字部队','1','length','3'),
		array('goods_sn','','货号不对','1','unique','3'),
		//array('shop_price','pr','价格错误','1','callback','3'),
		);

	/*public function pr(){
		return false;
	}*/
}


?>